<!DOCTYPE html>
<html>
<head>
	<meta charset="UTF-8">
	<title>Ejercicio 11</title>
	<script type="text/javascript">

		function setValue(valor) {
			document.querySelector("input[type=hidden]").value = valor;
		}

	</script>
	<style type="text/css">

		body {
			margin: 3%;
		}

		fieldset {
			display: inline-block;
		}

		label {
			display: block;
			margin: 15px 5px;
		}

		span {
			display: inline-block;
			width: 130px;
			margin-right: 20px;
		}

		.botones {
			display: block;
			position: relative;
			margin: 10px auto;
			width: 130px;	
		}

	</style>
</head>

<body>
	<h3>Ejercicio 11</h3>
	<form method="post">
		<fieldset>
			<legend>Formulario Libros</legend>		
			<label><span>Nombre del libro: </span><input type="text" name="nombre"></label>
			<label><span>ISBN: </span><input type="text" name="isbn"></label>
			<label><span>Categoría: </span><input type="text" name="categoria"></label>
			<div class="botones">
				<input type="submit" value="Añadir" onclick="setValue('create')">
				<input type="submit" value="Ver tabla" onclick="setValue('read')">
				<input type="hidden" name="action" value="">
			</div>			
		</fieldset>
	</form>
</body>
</html>